package com.xianzhi.controller.content;

import com.xianzhi.dto.AdDto;
import com.xianzhi.service.AdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

@Controller

public class LikeQueryController {
@Autowired
private AdService adService;

    @RequestMapping(value = "/like",method = RequestMethod.POST)
    public String init(ModelMap modelMap, HttpServletRequest request){
        //表示查询条件
        String title = request.getParameter("title");
        AdDto adDto =new AdDto();
        adDto.setTitle(title);
        modelMap.addAttribute("list",adService.searchByPage(adDto));
        return  "/content/adList";
    };

}
